package bussiness

import (
	mysqlDb "DouBan/db/mysql"
	"DouBan/model"
)

func JobSubscribe(infoClaim *model.InfoClaim, jobSubscribeRequest JobSubscribeRequest) (string, error) {
	userId := infoClaim.UserId
	subscribe := model.Subscribe{
		RentType:  jobSubscribeRequest.RentType,
		HouseType: jobSubscribeRequest.HouseType,
		UserId:    userId,
	}
	if err := mysqlDb.MasterDb().Create(&subscribe).Error; err != nil {
		return "创建订阅失败", err
	} else {
		return "创建订阅成功", nil
	}
}
